www.gusucode.com > 地方成人教育中心整站源代码 1 > 地方成人教育中心整站源代码 1.0/manage/Admin_Link.asp

    <!--#include file="chkuser.asp"-->
<!--#include file="conn.asp"-->
<!--#include file="Function/Function_Link.asp"-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="copyright" content="Copyright 2008 dananshan.com" />
<meta name="Author" content="闪电文章管理系统技术支持---www.dananshan.com" />
<meta name="Keywords" content="闪电文章管理系统文章管理系统" />
<meta name="Description" content="闪电文章管理系统文章管理系统" />
<title>友情链接管理</title>
<link href="style.css" rel="stylesheet" type="text/css" />
<script language="javascript" src="../js/Admin.js"></script>
</head>
<body>
<%
'========判断是否具有管理权限
if Instr(Session("AdminPower"),"|05,")=0 then 
	response.write ("<font color='red')>你不具有该管理模块的操作权限,请返回!</font>")
	response.end
else
	Call Main_Content()
    if Request.QueryString ("Form")="Add" then call Add_Content()
	if Request.QueryString ("Form")="Edit" then call Edit_Content() 
end if
%>
</body>
</html>
<%
Function Edit_Content()
	ID=trim(request("ID"))
	if ID<>"" and IsNumeric(ID) then
	sql="select * from Idea_Link where ID="&ID
	set rs=idea.exec(sql,1)
	do while not rs.eof
	response.write "<form action='?Action=update&ID="&ID&"' method='post'>"
	response.write "<table class='cTable table tCenter'>"
	response.write "<tr class='cTitle toolbarBg'>"
	response.write "<td colspan='2' align='left'><span class='light_bOrange'>&nbsp;&nbsp;&nbsp;&nbsp;编辑友情链接</span></td>"
	response.write "</tr><tr>"
	response.write "<td width='15%' class='tRight'>链接名称:</td>"
	response.write "<td width='85%' align='left'><input name='SiteName' type='text' size='40' value='"&rs("SiteName")&"'>"
	if rs("IsShow")=true then
	response.write "<input name='IsShow' type='checkbox' value='checkbox' checked='checked'>发布</td>"
	else
	response.write "<input name='IsShow' type='checkbox' value='checkbox'>发布</td>"
	end if
	response.write "</tr><tr>"
	response.write "<td class='tRight'>链接网址:</td>"
	response.write "<td width='85%' align='left'><input name='SiteUrl' type='text' size='40' value='"&rs("SiteUrl")&"'></td>"
	response.write "</tr><tr>"
	response.write "<td class='tRight'>链接类型:</td>"
	response.write "<td width='85%' align='left'><select name='LinkType'>"
	if rs("LinkType")=false then
	response.write "<option value='0' selected>文字</option>"
	response.write "<option value='1'>图片</option>"
	else
	response.write "<option value='0'>文字</option>"
	response.write "<option value='1' selected>图片</option>"
	end if
	response.write "</select></td>"
	response.write "</tr><tr>"
	response.write "<td class='tRight'>Logo地址:</td>"
	response.Write "<td width='85%' align='left'>"
	response.Write "<input name='pic' id='pic' type='text' size='40' value='"&rs("SiteLogo")&"'>&nbsp;"
	response.Write "<iframe src='up/upload.asp?Type=Pic&Class=Link' scrolling='no' topmargin='0' width='275' height='24' marginwidth='0' marginheight='0' frameborder='0' align='center'></iframe></td>"
	response.write "</tr>"
	rs.movenext
	loop
	rs.close
	set rs=nothing
	end if
	response.write "</table>"
	response.write "<div id='cEndToolbar' class='toolbarBg'>"
	response.write "<div class='caButCase' style='text-align:left;padding-left:16%;'>"
	response.write "<input type='submit' id='Btn_Edit' name='Btn_Edit' value='确定更新' class='button'>&nbsp;"
	response.Write "<input type='reset' name='Btn_EditReset' value='清空重填' class='button'>"
	response.write "</div>"
	response.write "</div>"
	response.write "</form>"
End Function 

Function Add_Content()
	response.write "<form action='?Action=add' method='post'>"
	response.write "<table class='cTable table tCenter'>"
	response.write "<tr class='cTitle toolbarBg'>"
	response.write "<td colspan='2' align='left'><span class='light_bOrange'>&nbsp;&nbsp;&nbsp;&nbsp;添加友情链接</span></td>"
	response.write "</tr><tr>"
	response.write "<td width='15%' class='tRight'>链接名称:</td>"
	response.write "<td width='85%' align='left'><input name='SiteName' type='text' size='40'>"
	response.write "<input name='IsShow' type='checkbox' value='checkbox' checked='checked'>发布</td>"
	response.write "</tr><tr>"
	response.write "<td class='tRight'>链接网址:</td>"
	response.write "<td width='85%' align='left'><input name='SiteUrl' type='text' size='40'></td>"
	response.write "</tr><tr>"
	response.write "<td class='tRight'>链接类型:</td>"
	response.write "<td width='85%' align='left'><select name='LinkType'>"
	response.write "<option value='0' selected>文字</option>"
	response.write "<option value='1'>图片</option>"
	response.write "</select></td>"
	response.write "</tr><tr>"
	response.write "<td class='tRight'>Logo地址:</td>"
	response.Write "<td width='85%' align='left'>"
	response.Write "<input name='pic' id='pic' type='text' size='40'>&nbsp;"
	response.Write "<iframe src='up/upload.asp?Type=Pic&Class=Link' scrolling='no' topmargin='0' width='275' height='24' marginwidth='0' marginheight='0' frameborder='0' align='center'></iframe></td>"
	response.write "</tr></table>"
	response.write "<div id='cEndToolbar' class='toolbarBg'>"
	response.write "<div class='caButCase' style='text-align:left;padding-left:16%;'>"
	response.write "<input type='submit' id='Btn_Add' class='button' name='Btn_Add' value='确定添加'>&nbsp;"
	response.Write "<input type='reset' name='Btn_AddReset' value='清空重填' class='button'>"
	response.write "</div>"
	response.write "</div>"
	response.write "</form>"
End Function

Function Main_Content()
	response.write "<div id='frame_Toolbar' class='toolbarBg'> "
	response.write "<a href='javascript:self.history.back();' class='icoBtn_ct'><span class='btnIco btnBack'></span><span class='btnTxt'>返回</span></a>"
	response.write "<a href='javascript:self.location.reload();' class='icoBtn_ct'><span class='btnIco btnReload'></span><span class='btnTxt'>刷新</span></a> <span class='split ftSplit' ></span>"
	response.write "<div id='guide'>点击<span class='light_orange'> 链接名称 </span>进行编辑</div>"
	response.write "<div class='pageInfo right light_gray'>[当前共有<span id='Label_total_top' class='light_bOrange'>"&Inf_Count()&"</span>条记录]</div>"
	response.write "</div>"
	response.write "<form method='POST' id=form2 name='form2'>"
	response.write "<div id='content'>"
	response.write "<table class='cTable table tCenter'>"
	response.write "<tr class='cTitle toolbarBg' id='Title'>"
	response.write "<td width='5%'><div>NO.</div></td>"
	response.write "<td width='15%'><span class='split ctSplit'></span><div>链接名称</div></td>"
	response.write "<td width='30%'><span class='split ctSplit'></span><div>链接地址</div></td>"
	response.write "<td width='10%'><span class='split ctSplit'></span><div>链接类型</div></td>"
	response.write "<td width='20%'><span class='split ctSplit'></span><div>发布日期</div></td>"
	response.write "<td width='10%'><span class='split ctSplit'></span><div>是否发布</div></td>"
	response.write "<td width='10%'><span class='split ctSplit'></span><div>"
	response.write "<input type='button' class='button' style='width:31px;height:19px;padding-top:2px;' name='Btn_Select' value='全选' onClick='selectall()'>&nbsp;"
	response.write "<input type='button' class='button' style='width:31px;height:19px;padding-top:2px;' name='Btn_Cancel' value='反选' onClick='cancelall()'>"
	response.write "</div>"
	response.write "</td>"
	response.write "</tr>"
	response.write "</table>"
	response.write "<table class='cTable table tCenter' cellspacing='0' border='0' style='border-collapse:collapse;'>"
    sql="select * from Idea_Link order by ID"
	set rs=idea.exec(sql,1)
	if not rs.eof then
		rs.pagesize=10
		curpage=Request.QueryString("curpage")
		if curpage="" then curpage=1
		rs.absolutepage=curpage
		for i=1 to rs.pagesize
		if rs.eof then
		exit for
		end if
		response.Write"<tr>"
		response.Write"<td align='center' style='width:5%;'><span>"&rs("ID")&"</span></td>"
		response.Write"<td style='width:15%;'><a href='?Form=Edit&ID="&rs("ID")&"''>"&rs("SiteName")&"</a></td>"
		response.Write"<td align='center' style='width:30%;'>"&rs("SiteUrl")&"</td>"
		if rs("LinkType")=true then
		response.Write"<td style='width:10%;'>图片</td>"
		else
		response.Write"<td style='width:10%;'>文字</td>"
		end if
		response.Write"<td style='width:20%;'>"&rs("AddDate")&"</td>"
		if rs("IsShow")=true then
		response.Write"<td style='width:10%;' align='center'><div style='width:15px;height:10px;background-image: url(images/IcoBtn.gif); background-repeat: no-repeat; border: 0;background-position: -470px -3px;'></div></td>"
		else
		response.Write"<td style='width:10%;' align='center'><div style='width:15px;height:10px;background-image: url(images/IcoBtn.gif); background-repeat: no-repeat; border: 0;background-position: -485px -3px;'></div></td>"
		end if
		response.Write"<td align='center' style='width:10%;'><div style='float:left;width:50px;height:17px;background-image: url(images/IcoBtn.gif); background-repeat: no-repeat; border: 0;background-position: -222px 0px;'><a href='?Form=Edit&ID="&rs("ID")&"''><img width='50' height='17' style='border:0;' src='images/Empty.gif'></a></div>"
		response.Write"<input type='checkbox' name='chk' value='"&rs("ID")&"' />"
		response.Write"</td>"
		response.Write"</tr>"
		rs.movenext
		next
	else
	    response.Write"<tr><td colspan='6' align='center' style='width:100%;'>还没有添加数据!</td><td></td></tr>"
	end if	
	response.Write "<tr>"
	response.Write "<td colspan='6' width='90%'></td>"
	response.Write "<td align='center'>"
	response.Write "<input type='submit' class='button' style='width:80px;height:19px;padding-top:2px;' id='Btn_DellAll' name='Btn_DellAll' value='删除所选' onClick=""document.form2.action='?Action=delall';return confirm('确定要删除吗?');"">"
	response.Write "</td>"
	response.Write "</tr>"
	response.Write "</table>" 
	response.Write "<div id='cEndToolbar' class='toolbarBg'>"
	response.Write "<div class='pageBtnDo'>"
	response.Write "<a href='?Form=Add'>添加链接</a>"
	response.Write "</div>"
	response.Write "<div class='pageList'>"
	if curpage=1 then
		Response.Write "首页&nbsp;|&nbsp;"
	else
		Response.Write "<a href='?curpage=1'>首页</a>&nbsp;|&nbsp;"
	end if
	if curpage=1 then
		Response.Write "上一页&nbsp;|&nbsp;"
	else
		Response.Write "<a href='?curpage="&curpage-1&"'>上一页</a>&nbsp;|&nbsp;"
	end if
	if rs.pagecount<curpage+1 then
		Response.Write "下一页&nbsp;|&nbsp;"
	else
		Response.Write "<a href='?curpage="&curpage+1&"'>下一页</a>&nbsp;|&nbsp;"
	end if
	if rs.pagecount<curpage+1 then
		Response.Write "尾页&nbsp;&nbsp;"
	else
		Response.Write "<a href='?curpage="&rs.pagecount&"'>尾页</a>&nbsp;&nbsp;"
	end if
		Response.Write "当前第"&curpage&"页&nbsp;"
		Response.Write "共"&rs.pagecount&"页&nbsp;&nbsp;"
	response.Write "</div>"
	rs.close()
	set rs=nothing
	response.Write "</div>"
	response.Write "</form>"
End Function
%>